Skip to content

fix(arrow/scalar): handle nil child values in run-end scalars - #1001

Merged
zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:fix/scalar-null-run-end-validation
Jul 27, 2026
Merged

fix(arrow/scalar): handle nil child values in run-end scalars#1001
zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:fix/scalar-null-run-end-validation

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

MakeNullScalar creates a null run-end encoded scalar without a child value. RunEndEncoded.Validate dereferenced that value before checking nullness, so validation could panic.

This handles the missing child explicitly: null scalars are accepted, malformed non-null scalars still fail, and both paths are covered by tests.

Tests: go test ./arrow/scalar

@fallintoplace
fallintoplace requested a review from zeroshade as a code owner July 24, 2026 23:32
@fallintoplace fallintoplace changed the title fix(arrow/scalar): validate null run-end encoded scalars fix(arrow/scalar): avoid nil dereferences in null run-end scalars Jul 25, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): avoid nil dereferences in null run-end scalars fix(arrow/scalar): handle missing values in null run-end scalars Jul 25, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): handle missing values in null run-end scalars fix(arrow/scalar): handle nil child values in run-end scalars Jul 25, 2026

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: `MakeNullScalar` for a run-end encoded type leaves `Value == nil`, and `RunEndEncoded.Validate` dereferenced it immediately — I reproduced the nil-pointer panic. Handling the missing child explicitly (accept for null scalars, error for a non-null scalar with no value) is correct. LGTM.

@zeroshade
zeroshade merged commit abf9187 into apache:main Jul 27, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants